<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Home extends CI_Controller {

	public function __construct() {
		parent::__construct();

		$this->load->model('category_model', 'cate');
		$this->load->model('article_model', 'article');

		$this->_data['category'] = $this->cate->get_category();
		$this->_data['right_list'] = $this->article->hot_list();

	}

	public function index() {
		$this->_data['arts'] = $this->article->home_articles();

		$this->load->view('index/home.html', $this->_data);
	}

	public function category() {
		$cid = $this->uri->segment(4);
		$this->_data['cate_arts'] = $this->article->category_article($cid);
		$this->load->view('index/category.html', $this->_data);
	}


	public function article() {
		$aid = $this->uri->segment(4);

		$this->_data['article'] = $this->article->aid_article($aid);
		$this->load->view('index/article.html', $this->_data);
	}

}

/* End of file home.php */
/* Location: ./application/controllers/home.php */